package com.yunqing.restkeeper.enterprise.web.controller;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName OSSConfig
 * @Description TODO
 * @author: puyunqing
 * @Date: 2025/7/3
 */
@Configuration
public class OSSConfig {

    @Value("${spring.cloud.alicloud.oss.endpoint}")
    private String endpoint;

    @Value("${spring.cloud.alicloud.access-key}")
    String accessKeyId;

    @Value("${spring.cloud.alicloud.secret-key}")
    String accessKeySecret;

    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
    }

}
